<?php defined('IN_LK') or die('Access Denied');?>
<?php include self::admin_t('header');?>
<dl class="form_list">
  <form action="?m=admin&c=index&a=edit_pwd" method="post" id="myform">
    <dd><span class="left w8">用户名</span><span class="green"><?php echo $username;?></span></dd>
    <dd><span class="left w8">email</span><span class="green"><?php echo $email;?></span></dd>
    <dd><span class="left w8">旧密码</span>
      <input type="password" class="input" size="30" name="oldpwd" id="oldpwd" value="" />
    </dd>
    <dd><span class="left w8">新密码</span>
      <input type="password" class="input" size="30" name="newpwd" id="newpwd" value="" />
    </dd>
    <dd><span class="left w8">确认密码</span>
      <input type="password" class="input" size="30" name="newpwd2" id="newpwd2" value="" />
    </dd>
    <dd>
      <input type="submit" class="btn" name="dosubmit" id="dosubmit" value="修改" />
      <input type="reset" class="btn" value="重置" />
    </dd>
  </form>
</dl>
<script type="text/javascript">
$(function()
{
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#oldpwd").formValidator({empty:true,onshow:"不修改密码请留空。",onfocus:"密码应该为3-20位之间",oncorrect:"旧密码输入正确"}).inputValidator({min:3,max:20,onerror:"密码应该为3-20位之间"}).ajaxValidator({
	    type : "get",
		url : "",
		data :"m=admin&c=index&a=check_pwd_ajax",
		datatype : "html",
		async:'false',
		success : function(data){
            if( data == "1" )
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#dosubmit"),
		onerror : "旧密码输入错误",
		onwait : "请稍候..."
	});
	$("#newpwd").formValidator({empty:true,onshow:"不修改密码请留空。",onfocus:"密码应该为3-20位之间"}).inputValidator({min:3,max:20,onerror:"密码应该为3-20位之间"});
	$("#newpwd2").formValidator({empty:true,onshow:"不修改密码请留空。",onfocus:"请输入两次密码相同。",oncorrect:"密码输入一致"}).compareValidator({desid:"newpwd",operateor:"=",onerror:"请输入两次密码相同。"});
});
</script>
<?php include self::admin_t('footer');?>
